﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SISGEZATBZVisual.BusinessEntities;
using SISGEZATBZVisual.Repository.Mapping;

namespace SISGEZATBZVisual.Repository
{
    public class SISGEZATBZVisualContext:DbContext
    {
        public SISGEZATBZVisualContext()
        {
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges<SISGEZATBZVisualContext>());
        }

        public DbSet<Alumno> Alumnos { get; set; }
        public DbSet<AñoAcademico> AñoAcademicos { get; set; }
        public DbSet<Grado> Grados { get; set; }
        public DbSet<Matricula> Matriculas { get; set; }
        public DbSet<Nivel> Nivels { get; set; }
        public DbSet<Seccion> Seccions { get; set; }
        public DbSet<TrasladoExterno> TrasladoExternos { get; set; }
        public DbSet<Egreso> Egresos { get; set; }
        public DbSet<TipoPago> TipoPagos { get; set; }
        public DbSet<Pago> Pagos { get; set; }
        public DbSet<AlumnoPago> AlumnoPagos { get; set; }
        public DbSet<Apoderado> Apoderados { get; set; }
        public DbSet<Docente> Docentes { get; set; }
        public DbSet<VisitaAdicionalAip> VisitaAdicionalAips { get; set; }
        public DbSet<Curso> Cursos { get; set; }
        public DbSet<CursoDocente> CursoDocentes { get; set; }
        public DbSet<NotaFinal> NotaFinals { get; set; }


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AlumnoMap());
            modelBuilder.Configurations.Add(new AñoAcademicoMap());
            modelBuilder.Configurations.Add(new GradoMap());
            modelBuilder.Configurations.Add(new MatriculaMap());
            modelBuilder.Configurations.Add(new NivelMap());
            modelBuilder.Configurations.Add(new SeccionMap());
            modelBuilder.Configurations.Add(new TrasladoExternoMap());
            modelBuilder.Configurations.Add(new EgresoMap());
            modelBuilder.Configurations.Add(new TipoPagoMap());
            modelBuilder.Configurations.Add(new PagoMap());
            modelBuilder.Configurations.Add(new AlumnoPagoMap());
            modelBuilder.Configurations.Add(new ApoderadoMap());
            modelBuilder.Configurations.Add(new DocenteMap());
            modelBuilder.Configurations.Add(new VisitaAdicionalAipMap());
            modelBuilder.Configurations.Add(new CursoMap());
            modelBuilder.Configurations.Add(new CursoDocenteMap());
            modelBuilder.Configurations.Add(new NotaFinalMap());
        }
    }
}
